import request from '@/utils/request'

// 查询环境信息列表
export function listEnvironmentInfo(query) {
  return request({
    url: '/kindergarten/environmentInfo/list',
    method: 'get',
    params: query
  })
}

// 查询环境信息详细
export function getEnvironmentInfo(id) {
  return request({
    url: '/kindergarten/environmentInfo/' + id,
    method: 'get'
  })
}

// 新增环境信息
export function addEnvironmentInfo(data) {
  return request({
    url: '/kindergarten/environmentInfo',
    method: 'post',
    data: data
  })
}

// 修改环境信息
export function updateEnvironmentInfo(data) {
  return request({
    url: '/kindergarten/environmentInfo',
    method: 'put',
    data: data
  })
}

// 删除环境信息
export function delEnvironmentInfo(id) {
  return request({
    url: '/kindergarten/environmentInfo/' + id,
    method: 'delete'
  })
}

export function getValue(id) {
  return request({
    url: '/twinPhysicalDevice',  // 后端接口地址
    method: 'get',
    params: { key: id }  // 关键：通过 params 传递参数，后端用 @RequestParam("key") 接收
  });
}